package yaty.lee.ssh2.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import yaty.lee.ssh2.dao.PersonDao;
import yaty.lee.ssh2.model.Person;
import yaty.lee.ssh2.service.PersonService;

@Service("personService")
public class PersonServiceImpl implements PersonService {
	@Autowired
	private PersonDao personDao;

	@Override
	public Person findbyEmplid(Long emplid) {
		return personDao.findbyEmplid(emplid);
	}

	@Override
	public List<Person> findAllEmployees() {
		return personDao.findAllEmployees();
	}

	@Override
	@Transactional
	public void update(Person person) {
		personDao.update(person);
	}

	@Override
	@Transactional
	public void delete(Person person) {
		personDao.delete(person);
	}

	@Override
	@Transactional
	public void save(Person person) {
		personDao.save(person);
	}

	public void setPersonDao(PersonDao personDao) {
		this.personDao = personDao;
	}

}
